<div class="deal">
<div class="deal_content_top"></div>
<div class="deal_content">
<h3>Category</h3>

<?php
if (count($this->items) == 0) {
	echo "<tr><td colspan='3' align='center'>No order</td></tr>";
} else {
	?>
    
<table class="table-style" style="width: 100%;" cellpadding="5px"
	cellspacing="0">
	<tbody>
		<tr class="table-title">
			<td>Deal</td>
			<td>Giá</td>
			<td>Số lượng</td>
			<td>Thanh toán</td>
			<td>Barcode</td>
			<td>Trạng thái</td>
		</tr>
			<?php $i = 0 ?>
			<?php foreach ($this->items as $item): ?>
		<tr class="<?php echo $i % 2 == 0 ? 'even' : 'odd' ?>">
			<td><a href="<?php echo $this->baseUrl('index.php/cms/index/deal/id/' . $item->deal_id) ?>"><?php echo $this->deals[$i] ?></a></td>
			<td><?php echo $item->price ?></td>
			<td><?php echo $item->quantity ?></td>
			<td><?php echo $item->row_total ?></td>
			<td><?php echo $item->barcode ?></td>
			<td><?php echo $this->barcode_status[$item->barcode_status] ?></td>
		</tr>
            <?php $i++ ?>
		<?php endforeach ?>
	</tbody>
</table>
		
<?php echo $this->items; ?>

<?php } ?>

<table>
    <tr>
        <td colspan="2"><strong>Thông tin người mua</strong></td>
    </tr>
    <tr>
        <td align="right">Tên *: </td>
        <td><?php echo $this->shipping_address["name"] ?></td>
    </tr>
    <tr>
        <td align="right">Email *: </td>
        <td><?php echo $this->shipping_address["email"] ?></td>
    </tr>
    <tr>
        <td align="right">Điện thoại *: </td>
        <td><?php echo $this->shipping_address["phone"] ?></td>
    </tr>
    <tr>
        <td align="right">Địa chỉ *: </td>
        <td><?php echo $this->shipping_address["shipping_address"] ?></td>
    </tr>
</table>

<br /><br />

<table>
    <tr>
        <td colspan="2"><strong>Thông tin tài khoản</strong></td>
    </tr>
    <tr>
        <td align="right">Loại: </td>
        <td><?php echo $this->order_type ?></td>
    </tr>
    <tr>
</table>

<form action="<?php echo $this->url(array("module" => "admin_cms", "controller" => "order", "action" => "editpost")) ?>" method="post">
<table>
    <tr>
        <td><strong>Trạng thái: </strong></td>
        <td>
            <select name="cbxStatus">
                <?php
                for($i = 1; $i <= count($this->enumStatus); $i++)
                {
                   if($i == $this->order->status)
                   {
                        echo "<option selected value='$i'>{$this->enumStatus[$i]}</option>";
                   }
                   else
                   {
                        echo "<option value='$i'>{$this->enumStatus[$i]}</option>";
                   }
                }
                ?>
            </select>
        </td>
        <td>
            <input type="submit" value="Cập nhật" />
        </td>
    </tr>
</table>
<input type="hidden" name="txtId" value="<?php echo $this->orderId ?>" />
</form>

</div>

<div class="deal_content_bottom"></div>
</div>
